<template "ui/head" />
<template "ui/iframe" />
<ui table($table) />
<script type="text/javascript">
    var player = function () { };
</script>
<if $LF['layerid']>
    <script type="text/javascript">
        player = function () {
            parent.parent.layer.restore(`{{$LF['layerid']}}`);
        };
    </script>
</if>
<script type="text/javascript">
    var choice = function (obj) {
        let data = obj.data, list = [];
        if (!data.length) {
            data = [data];
        }
        data.map((item) => {
            list.push({
                src: item.src,
                original: item.src
            });
        });
        parent.LCMS.plugin.file.add(`{{$LF['id']}}`, list);
        LCMS.util.iframe({do: "close"});
        player();
    }
</script>
<template "ui/foot" />